#include "..\base\ASDataType.h"
#include "..\base\ASStdLib.h"

typedef struct
{
    ASINT	title_cn;
    ASSTR	 img_small;
    ASSTR	 img_large;
    ASSTR	 txt_cn;
    ASUINT16 btried;
} as_item_content;

typedef struct
{
    ASINT title_cn;
} as_category_title;

#define AS_ITEMS_COUNT	106
#define AS_UNVALID_ITEM_ID	255

#define AS_CATEGORY_SIXTY_COUNT	6
#define AS_CATEGORY_BUTTERFLY_COUNT	12
#define AS_CATEGORY_COWGIRL_COUNT 11
#define AS_CATEGORY_CUNNI_COUNT	12
#define AS_CATEGORY_DOGGY_COUNT	9
#define AS_CATEGORY_EXOTIC_COUNT 14
#define AS_CATEGORY_FACETOFACE_COUNT 19
#define AS_CATEGORY_FELL_COUNT 13
#define AS_CATEGORY_SPOON_COUNT 10

typedef enum
{
    ENUM_CATEGORY_SIXTY = 0,
    ENUM_CATEGORY_BUTTERFLY,
    ENUM_CATEGORY_COWGIRL,
    ENUM_CATEGORY_CUNNI,
    ENUM_CATEGORY_DOGGY,
    ENUM_CATEGORY_EXOTIC,
    ENUM_CATEGORY_FACETOFACE,
    ENUM_CATEGORY_FELL,
    ENUM_CATEGORY_SPOON,
    ENUM_CATEGORY_COUNT,

    ENUM_RECORD_TODO,
    ENUM_RECORD_FAVORITE,
    ENUM_RECORD_TRIED,
    ENUM_RECORD_UNTRIED,
    ENUM_RECORD_RECENT,
    ENUM_RECORD_COUNT,
    ENUM_RECORD_ALL,
    ENUM_RECORD_RANDOM
} ENUM_CATEGORY;


typedef enum
{
    OFF,
    ON
} SWITCH;

typedef struct
{
    ASINT8 music_switch;
} as_global_config;


as_item_content* as_logic_get_item(ASINT idx);
void as_logic_init_items(void);
void as_logic_init_category(void);
void as_logic_get_category(ASINT idx, ASINT* idx_begin, ASINT* idx_end);
void as_logic_init_item_record(void);
void as_logic_add_recent(ASINT itemid);
void as_logic_add_favorite(ASINT itemid);
void as_logic_del_favorite(ASINT itemid);
void as_logic_add_tried(ASINT itemid);
void as_logic_del_tried(ASINT itemid);
void as_logic_add_todo(ASINT itemid);
void as_logic_del_todo(ASINT itemid);
ASUINT8* as_logic_get_record(ASINT categoryid);
ASINT as_logic_get_record_count(ASINT categoryid);
void as_logic_init_category_title(void);
as_global_config* as_get_global_config(void);
void as_init_global_config(void);
as_category_title* as_logic_get_category_title(ASINT categoryid);
ASINT as_logic_get_percent(ASINT categoryid);
ASINT as_logic_translate_idx(ASINT idx, ASINT cate_id);